home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 22 / PCPP #22.iso / Quake2 / q2source_12_11 / utils3 / qe4 / qe3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-11  |  5.7 KB  |  285 lines

  1. #ifndef __QE3_H__
  2. #define __QE3_H__
  3.  
  4. // disable data conversion warnings for gl
  5. #pragma warning(disable : 4244)     // MIPS
  6. #pragma warning(disable : 4136)     // X86
  7. #pragma warning(disable : 4051)     // ALPHA
  8.  
  9. #include <windows.h>
  10.  
  11. #include <gl/gl.h>
  12. #include <gl/glu.h>
  13. #include <gl/glaux.h>
  14. #include "glingr.h"
  15. #include <math.h>
  16. #include <stdlib.h>
  17.  
  18. #include "cmdlib.h"
  19. #include "mathlib.h"
  20. #include "parse.h"
  21. #include "lbmlib.h"
  22.  
  23. #include <commctrl.h>
  24. #include "afxres.h"
  25. #include "resource.h"
  26.  
  27. #include "qedefs.h"
  28.  
  29. typedef struct
  30. {
  31.     vec3_t    normal;
  32.     double    dist;
  33.     int        type;
  34. } plane_t;
  35.  
  36. #include "qfiles.h"
  37.  
  38. #include "textures.h"
  39. #include "brush.h"
  40. #include "entity.h"
  41. #include "map.h"
  42. #include "select.h"
  43.  
  44. #include "camera.h"
  45. #include "xy.h"
  46. #include "z.h"
  47. #include "mru.h"
  48.  
  49. typedef struct
  50. {
  51.     int        p1, p2;
  52.     face_t    *f1, *f2;
  53. } pedge_t;
  54.  
  55. typedef struct
  56. {
  57.     int          iSize;
  58.     int          iTexMenu;        // nearest, linear, etc
  59.     float      fGamma;            // gamma for textures
  60.     char      szProject[256];    // last project loaded
  61.     vec3_t      colors[COLOR_LAST];
  62.     qboolean  show_names,
  63.               show_coordinates;
  64.     int       exclude;
  65. } SavedInfo_t;
  66.  
  67. //
  68. // system functions
  69. //
  70. void    Sys_UpdateStatusBar( void );
  71. void    Sys_UpdateWindows (int bits);
  72. void    Sys_Beep (void);
  73. void    Sys_ClearPrintf (void);
  74. void    Sys_Printf (char *text, ...);
  75. double    Sys_DoubleTime (void);
  76. void    Sys_GetCursorPos (int *x, int *y);
  77. void    Sys_SetCursorPos (int x, int y);
  78. void    Sys_SetTitle (char *text);
  79. void    Sys_BeginWait (void);
  80. void    Sys_EndWait (void);
  81. void    Sys_Status(const char *psz, int part);
  82.  
  83. /*
  84. ** most of the QE globals are stored in this structure
  85. */
  86. typedef struct
  87. {
  88.     qboolean d_showgrid;
  89.     int      d_gridsize;
  90.  
  91.     int      d_num_entities;
  92.  
  93.     entity_t *d_project_entity;
  94.  
  95.     float     d_new_brush_bottom_z,
  96.               d_new_brush_top_z;
  97.  
  98.     HINSTANCE d_hInstance;
  99.  
  100.     HGLRC     d_hglrcBase;
  101.     HDC       d_hdcBase;
  102.  
  103.     HWND      d_hwndMain;
  104.     HWND      d_hwndCamera;
  105.     HWND      d_hwndEdit;
  106.     HWND      d_hwndEntity;
  107.     HWND      d_hwndTexture;
  108.     HWND      d_hwndXY;
  109.     HWND      d_hwndZ;
  110.     HWND      d_hwndStatus;
  111.  
  112.     vec3_t    d_points[MAX_POINTS];
  113.     int       d_numpoints;
  114.     pedge_t   d_edges[MAX_EDGES];
  115.     int       d_numedges;
  116.  
  117.     int       d_num_move_points;
  118.     float    *d_move_points[1024];
  119.  
  120.     qtexture_t    *d_qtextures;
  121.  
  122.     texturewin_t d_texturewin;
  123.  
  124.     int             d_pointfile_display_list;
  125.  
  126.     xy_t         d_xy;
  127.  
  128.     LPMRUMENU    d_lpMruMenu;
  129.  
  130.     SavedInfo_t  d_savedinfo;
  131.  
  132.     int          d_workcount;
  133.  
  134.     // connect entities uses the last two brushes selected
  135.     int             d_select_count;
  136.     brush_t        *d_select_order[2];
  137.     vec3_t       d_select_translate;    // for dragging w/o making new display lists
  138.     select_t     d_select_mode;
  139.  
  140.     int             d_font_list;
  141.  
  142.     int          d_parsed_brushes;
  143.  
  144.     qboolean    show_blocks;
  145. } QEGlobals_t;
  146.  
  147. void *qmalloc (int size);
  148. char *copystring (char *s);
  149. char *ExpandReletivePath (char *p);
  150.  
  151. void Pointfile_Delete (void);
  152. void Pointfile_Check (void);
  153. void Pointfile_Next (void);
  154. void Pointfile_Prev (void);
  155. void Pointfile_Clear (void);
  156. void Pointfile_Draw( void );
  157. void Pointfile_Load( void );
  158.  
  159. //
  160. // drag.c
  161. //
  162. void Drag_Begin (int x, int y, int buttons,
  163.            vec3_t xaxis, vec3_t yaxis,
  164.            vec3_t origin, vec3_t dir);
  165. void Drag_MouseMoved (int x, int y, int buttons);
  166. void Drag_MouseUp (void);
  167.  
  168. //
  169. // csg.c
  170. //
  171. void CSG_MakeHollow (void);
  172. void CSG_Subtract (void);
  173.  
  174. //
  175. // vertsel.c
  176. //
  177.  
  178. void SetupVertexSelection (void);
  179. void SelectEdgeByRay (vec3_t org, vec3_t dir);
  180. void SelectVertexByRay (vec3_t org, vec3_t dir);
  181.  
  182. void ConnectEntities (void);
  183.  
  184. extern    int    update_bits;
  185.  
  186. extern    int    screen_width;
  187. extern    int    screen_height;
  188.  
  189. extern    HANDLE    bsp_process;
  190.  
  191. char    *TranslateString (char *buf);
  192.  
  193. void ProjectDialog (void);
  194.  
  195. void FillTextureMenu (void);
  196. void FillBSPMenu (void);
  197.  
  198. BOOL CALLBACK Win_Dialog (
  199.     HWND hwndDlg,    // handle to dialog box
  200.     UINT uMsg,    // message
  201.     WPARAM wParam,    // first message parameter
  202.     LPARAM lParam     // second message parameter
  203. );
  204.  
  205.  
  206. //
  207. // win_cam.c
  208. //
  209. void WCam_Create (HINSTANCE hInstance);
  210.  
  211.  
  212. //
  213. // win_xy.c
  214. //
  215. void WXY_Create (HINSTANCE hInstance);
  216.  
  217. //
  218. // win_z.c
  219. //
  220. void WZ_Create (HINSTANCE hInstance);
  221.  
  222. //
  223. // win_ent.c
  224. //
  225.  
  226.  
  227. //
  228. // win_main.c
  229. //
  230. void Main_Create (HINSTANCE hInstance);
  231. extern BOOL SaveWindowState(HWND hWnd, const char *pszName);
  232. extern BOOL LoadWindowState(HWND hWnd, const char *pszName);
  233.  
  234. extern BOOL SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize);
  235. extern BOOL loadRegistryInfo(const char *pszName, void *pvBuf, long *plSize);
  236.  
  237. //
  238. // entityw.c
  239. //
  240. BOOL CreateEntityWindow(HINSTANCE hInstance);
  241. void FillClassList (void);
  242. BOOL UpdateEntitySel(eclass_t *pec);    
  243. void SetInspectorMode(int iType);
  244. int DrawTexControls(HWND hWnd);
  245. void SetSpawnFlags(void);
  246. void GetSpawnFlags(void);
  247. void SetKeyValuePairs(void);
  248. extern void BuildGammaTable(float g);
  249.  
  250.  
  251. // win_dlg.c
  252.  
  253. void DoGamma(void);
  254. void DoFind(void);
  255. void DoRotate(void);
  256. void DoSides(void);
  257. void DoAbout(void);
  258. void DoSurface(void);
  259.  
  260. /*
  261. ** QE function declarations
  262. */
  263. void     QE_CheckAutoSave( void );
  264. void     QE_ConvertDOSToUnixName( char *dst, const char *src );
  265. void     QE_CountBrushesAndUpdateStatusBar( void );
  266. void     QE_CheckOpenGLForErrors(void);
  267. void     QE_ExpandBspString (char *bspaction, char *out, char *mapname);
  268. void     QE_Init (void);
  269. qboolean QE_KeyDown (int key);
  270. qboolean QE_LoadProject (char *projectfile);
  271. qboolean QE_SingleBrush (void);
  272.  
  273. /*
  274. ** QE Win32 function declarations
  275. */
  276. int  QEW_SetupPixelFormat(HDC hDC, qboolean zbuffer );
  277. void QEW_StopGL( HWND hWnd, HGLRC hGLRC, HDC hDC );
  278.  
  279. /*
  280. ** extern declarations
  281. */
  282. extern QEGlobals_t   g_qeglobals;
  283.  
  284. #endif
  285.